# 读取输入的年龄和安静心率
age = int(input())
resting_heart_rate = int(input())

# 计算最适宜运动心率的范围
max_heart_rate = 220 - age - resting_heart_rate
min_exercise_heart_rate = max_heart_rate * 0.6 + resting_heart_rate
max_exercise_heart_rate = max_heart_rate * 0.8 + resting_heart_rate

# 输出最适宜的运动心率范围，精确到小数点后1位
print(f"{min_exercise_heart_rate:.1f}~{max_exercise_heart_rate:.1f}")